<!--查询变更单结果-->
<div id="taskDiv" class="container-fluid">
    <div class="panel panel-warning">
        <div class="panel-heading">查询到的变更单</div>
        <div class="panel-body table-responsive">
            <table class="table">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>变更单号</th>
                    <th>变更单名称</th>
                    <th>申请人</th>
                    <th>状态</th>
                    <th>环节</th>
                    <th>处理人</th>
                    <th>历史</th>
                </tr>
                </thead>
                <tbody>
                <% var recCount=(curFindAllPage-1)*30%>
                <% tasks.forEach(function(task,i){ var psId=task.processStepId%>
                    <% recCount++;%>
                    <tr id="myToBeDealTask">
                        <td><%=recCount%></td>
                        <%if(task.dealerName==user.realName){%>
                            <td><a id="task_<%=task.taskid%>" createName="<%=task.createrName%>" dealerName="<%=task.dealerName%>" step="taskProcessStepId_<%=task.processStepId%>" taskid="<%=task.taskid%>" taskcreater="<%=task.creater%>"><%=task.taskcode%></a></td>
                            <td><a id="task_<%=task.taskid%>" createName="<%=task.createrName%>" dealerName="<%=task.dealerName%>" step="taskProcessStepId_<%=task.processStepId%>" taskid="<%=task.taskid%>" taskcreater="<%=task.creater%>"><%=task.taskname%></a></td>
                        <%}else{%>
                            <td><%=task.taskcode%></td>
                            <td><%=task.taskname%></td>
                        <%}%>
                        <td><%=task.createrName%></td>
                        <td><%=task.state%></td>
                        <td><%=task.stepName%></td>
                        <td><%=task.dealerName==null?'':task.dealerName%></td>
                        <td>&nbsp;&nbsp;<a class="glyphicon glyphicon-time" btnType="taskHistory" taskId="<%=task.taskid%>"></a></td>
                    </tr>
                <% }); %>
                </tbody>
            </table>
        </div>
        <!--<% if(taskCount){%>-->
            <!--<div class="panel-footer">共<%=taskCount%>条</div>-->
        <!--<% } %>-->
        <div id="recCount" class="panel-footer" recCount="<%=recCount%>">共<%=recCount%>条</div>
    </div>
    <div style="float:right">
        <nav  >
            <%
            var  minPage = curFindAllPage-2>0?curFindAllPage-2:1;
            var maxPage = minPage + 4>totalFindAllPage?totalFindAllPage:minPage + 4;
            minPage = maxPage-4<1?1:maxPage-4;
            //                          var maxPage =curCreatePage+2>totalDealPage?totalDealPage:curCreatePage+2;
            %>
            <ul class="pagination" id="pageUl" pageCount="<%=totalFindAllPage%>" curPage="<%=curFindAllPage%>"
                minPage="<%=minPage%>",maxPage="<%=maxPage%>">

                <%if(minPage!=1){%>
                <li  id="pagePre">
                    <a  href="/task/findAllTask/<%=parseInt(curFindAllPage)-1%>" aria-label="Previous" >
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <%}%>
                <%for(var i = minPage;i<=maxPage;i++){ %>
                <li  class="pageId"  value ="<%=i%>"><a  href="/task/findAllTask/<%=i%>"><%=i%></a></li>
                <%}%>
                <%if(maxPage<totalFindAllPage){%>
                <li  id="pageNext">
                    <a  href="/task/findAllTask/<%=parseInt(curFindAllPage)+1%>" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
                <%}%>
            </ul>
        </nav>
    </div>

</div>
<div id="noTaskNotice" style="margin-top: 100px">
    <div class="col-sm-3"></div>
    <div class="col-sm-6">
            <span style="font-size:20pt; color: #cccccc;height:20px; line-height:20px; text-align:center; display:block;">
                没有找到符合条件的变更单
            </span>
    </div>
    <div class="col-sm-3"></div>
</div>
<script>

    var curPage =$('ul#pageUl').attr("curPage");
    $('li.pageId[value='+curPage+']').addClass('active');

//    var conds = window.sessionStorage.getItem("finAllTaskConds");
//    $("li#pagePre a").each(function () {
//        var url = $(this).attr("url");
//        $(this).attr("url", url + "/" + conds);
//    });
//    $("li.pageId a").each(function () {
//        var url = $(this).attr("url");
//        $(this).attr("url", url + "/" + conds);
//    });
//    $("li#pageNext a").each(function () {
//        var url = $(this).attr("url");
//        $(this).attr("url", url + "/" + conds);
//    });
</script>